
# a = ('A', 'A', 'A', 'O')
a = ('O','A', 'A',  'A')
def panduan(aa):
    lens = len(aa)
    print lens
    for i in xrange(lens -2):
        if aa[i] == aa[i+1] == aa[i+2] == "A":
            return False
    return True

bo = panduan(a)
print bo